//
// Created by Administrator on 2021/5/24.
// @file DBusServiceBase.cpp
// @author jmdvirus
// @date $YEAR-$MONTH-24 15:22:08
//

#include "DBusServiceBase.h"

DBusServiceBase::DBusServiceBase() {}

DBusServiceBase::~DBusServiceBase() {}

int DBusServiceBase::Init(bool server)
{
    if (!server)
    {
        DBus::_init_threading();
    }
    DBus::default_dispatcher = &dispatcher;
    if (!server)
    {
        new DBus::DefaultTimeout(100, false, &dispatcher);
    }
    return 0;
}

int DBusServiceBase::Deinit()
{
    dispatcher.leave();
    return 0;
}

int DBusServiceBase::Run()
{
    dispatcher.enter();
    return 0;
}
